package com.jyw.business.ast.domain.dto.web;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jyw.business.ast.constant.AstRelationConstant;
import com.jyw.business.ast.domain.AstBorrow;
import com.jyw.business.ast.domain.AstDealRelation;
import com.jyw.common.annotation.Excel;
import com.jyw.common.utils.DateUtils;
import com.jyw.common.utils.SecurityUtils;
import com.jyw.common.utils.bean.BeanUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 资产-借用信息对象 ast_borrow
 * 
 * @author system
 * @date 2023-10-19
 */
@Data
@ApiModel("资产借用-归还")
public class AstBorrowReturnDto
{

    /** 借出科室 */
    @ApiModelProperty("借出科室")
    private Long id;

    /** 归还人 */
    @ApiModelProperty("归还人")
    @Excel(name = "归还人")
    private String returnUser;

    /** 归还人电话 */
    @ApiModelProperty("归还人电话")
    @Excel(name = "归还人电话")
    private String returnPhone;

    /** 归还日期 */
    @ApiModelProperty("归还日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "归还日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date returnDate;

    /** 归还备注 */
    @ApiModelProperty("归还备注")
    @Excel(name = "归还备注")
    private String returnRemark;

    public AstBorrow buildBorrow(){
        AstBorrow borrow = new AstBorrow();
        BeanUtils.copyProperties(this,borrow);
        borrow.setState("4");
        return borrow;
    }
}
